//直接在code的右上角点击运行

class model2 {
    num: number = 0;
    str: string = "";
    arr: Array<number> = [1, 1, 1];

    constructor()
    {}
}



///////////////////////////////////

class model {
    num: number = 0;
    str: string = "";
    arr: Array<number> = [1, 1, 1];
    myModel2: model2 = new model2();


    方法(): void {

    }
}

//将模型直接输出
let my = new model();
let json: any = JSON.stringify(my)
console.log('json' + json);


//将字符转化为json后输出
let my2 = JSON.parse(json);
console.log(my2);
console.log('class' + my2);


//将字符串直接赋值class
let my3: model = JSON.parse(json);
console.log(my3.num);







